<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>学生信息管理系统</title>
<link rel="stylesheet" href="https://www.layuicdn.com/layui/css/layui.css">
<script src="https://www.layuicdn.com/layui/layui.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://www.layuicdn.com/layer/layer.js"></script>
<style type="text/css">
.all{
	position: absolute;
	top: 0px;
	left: 0px;
	right: 0px;
	bottom: 0px;
}
.all::-webkit-scrollbar{
    display: none;
}
.a::-webkit-scrollbar{
    display: none;
}
</style>
</head>
<body class="layui-layout-body">
	<div class="layui-layout layui-layout-admin">
		<div class="layui-header layui-row">
			<div class="layui-logo">
				<a style="color: white;" href="dashboard">学生信息管理系统</a>
			</div>
			<ul class="layui-nav layui-col-xs-offset10" id="nav">
				<li class="layui-nav-item"><a href="javascript:;">首页</a></li>
				<li class="layui-nav-item"><a href="javascript:;">欢迎您</a>
					<dl class="layui-nav-child">
						<dd>
							<a href="javascript:;">个人信息</a>
						</dd>
						<dd>
							<a onclick="exit()" href="javascript:;">退出</a>
						</dd>
					</dl></li>

			</ul>
		</div>
		<div class="layui-side">
			<ul class="layui-nav layui-nav-tree layui-inline"
				style="height: 100%" lay-filter="side">
				<li class="layui-nav-item layui-this"><a layui-id="1" href="javascript:;">个人信息</a></li>
				<li class="layui-nav-item">
				    <a href="javascript:;">课程信息</a>
				    <dl class="layui-nav-child">
				      <dd><a layui-id="2" href="javascript:;">查询课程</a></dd>
				      <dd><a layui-id="3" href="javascript:;">考试认证</a></dd>
				    </dl>
				</li>
				<li class="layui-nav-item"><a layui-id="6" href="javascript:;">成绩查询</a></li>
				<li class="layui-nav-item"><a layui-id="5" href="javascript:;">关&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;于</a></li>
			</ul>
		</div>
		<div class="layui-body a">
			<div class="all">
				<iframe id="body" src="self" height="100%" width="100%"></iframe>
			</div>
		</div>
		<div class="layui-footer">版权所有：浅梦凉城</div>
	</div>
	<script>
		layui.use('element', function() {
			var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块
			//监听导航点击
			element.on('nav(side)', function(elem){
				var id = $(this).attr('layui-id');
				if(id == '1'){
					$("#body").attr('src', 'self')
				}else if(id == '2'){
					$("#body").attr('src', 'search')
				}else if(id == '3'){
					$("#body").attr('src', 'course?page=1&limit=9')
				}else if(id == '4'){
					$("#body").attr('src', 'grade?page=1&limit=9')
				}else if(id == '5'){
					$("#body").attr('src', 'about')
				}else if(id == '6'){
					$("#body").attr('src', 'grade2')
				}
				
			});
		});
		function exit(){
			$.getJSON('student/exit', function(res){
				if(res.code == "00000"){
					layer.alert('退出成功');
					window.location.href = 'login.html';
				}else{
					layer.alert(res.message);
				}
			})
		}
	</script>
</body>
</html>
